/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.RoleDao;
import com.rbh.risk.entity.Role;
import com.rbh.risk.service.RoleService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("roleService")
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleDao roleDao;

    @Transactional(readOnly = false)
    @Override
    public void insert(Role role) {
        this.roleDao.insert(role);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(Role role) {
        this.roleDao.update(role);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(Role role) {
        this.roleDao.delete(role);
    }

    @Transactional(readOnly = true)
    @Override
    public Role getById(Integer roleId) {
        return this.roleDao.getById(roleId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Role> getAll() {
        return this.roleDao.getAll();
    }
}
